<?php


//class definition for event
class event

{
	public $summary;
	public $dtend;
	public $dtstart;
	public $kTimeslots;
	public $recurring;
	public $description;
	
	function setProperties($date,$timeslot,$duration,$summary) {
		global $kTimeslots;
		$this->summary = $summary;
		$dtstart = clone $date;
		$dtstart->setTime($this->kTimeslots[$timeslot]['start_hour'],$this->kTimeslots[$timeslot]['start_min']);
		$dtend = clone $dtstart;
		$dtend->modify('+'.$duration.' minutes');
		$this->dtend = $dtend;
		$this->dtstart = $dtstart;
	}
	
	function setDescription($customfields) {
		#function to set the description to contact a list of custom fields
		if (count($customfields>0)) {
			foreach ($customfields as $field) {
				$this->description .= sprintf('%s = %s\n',$field['varname'],$field['data']);
			}
		}
	}

}

?>